package br.com.felix.commandline;

import br.com.felix.util.ILogDevice;

/**
 * ILogDevice implementation that prints on the console.
 * @see ILogDevice
 * */
public class ConsoleLog implements ILogDevice{

	private boolean errorHasOcurred = false;
	public void log(String str) {
		System.out.println(str);
	}
	
	
	public void error(String msg, Exception e) {
		errorHasOcurred = true;
		log(msg);
		e.printStackTrace();
	}


	@Override
	public boolean errorHasOcurred() {
		return errorHasOcurred;
	}


	@Override
	public void lookForErrorsAgain() {
		errorHasOcurred = false;
	}
	
	

}
